If a variable is undefined, its value is ____
1.0
2. 1
3.NULL
4.garbage
In Perl, the words function and subroutines are used interchangeably.
1.True
2.False
3.All the above
4.none of the above
It is often more convenient to save perl program files with ____ extension
1. .gp
2..sh
3..awk
4..pl
substr function is also used to alter an existing string.
1.True
2.False
3.all of the above
4.asStub()
The "+=Â is which type of operator?
1.comparison operators
2.Arithmetic operators
3.Increment/ decrements operators
4.Assignment operators
The getdir command
1.Reads a single file name from an open directory handle
2.Reads the rest of the file names from an open directory handle
3.Only works after anopendir command
4.Is not a perl command
To repeat a string, perl uses ___ operator.
1. /
2..
3.x
4.\
What will be printed by the code below? my $val = {}; print ref($val);
1.empty value
2.Array
3.Hash
4.Scalar
When a string is used for numeral computations, perl converts it into
1.character
2.floating point number
3.number
4.boolean value
Which function can combine the functionalities of push, pop, unshift and shift?
1.splice
2.add
3.delete
4.split
___ function returns the first occurrence of a character in a string.
1.string
2.index
3. split
4. length
A perl program runs in a special interpretive mode.
1.True
2.False
3.all of the above
4.none of the above
Command line arguments in Perl are stored in
1.Scalar
2. Resource
3.Array
4.Hash
For deleting the elements from the left of the array ___ function is used.
1. pop
2.push
3.queue
4.shift
For deleting the elements from the right of the array ___ function is used.
1.pop
2.push
3.queue
4.shift
For extracting a substring, ____ function is used.
1.string
2.index
3.substr
4.length
How do you perform a forward declaration of a subroutine performed?
1.forward sub name
2. sub name
3.forward name
4.sub name {}
It is often more convenient to save perl program files with ____ extension.
1. .gp
2. .sh
3. .awk
4. .pl
Language which features rich text processing capabilities and flexibility is
1.Perl
2. C
3.Visual Basic
4.Ada
perl variables have no type and no initialization.
1.True
2.False
3.all of the above
4.none of the above
Scalar is denoted by_______in Perl.
1.#
2. $
3.%
4.^
Scalar stores
1.Multiple value
2.Single value
3.Double value
4. Float value
Select comparison operator from the options.
1. *=
2. &&
3.!=
4.=
Select the option which allows the user to scroll through the entire program line by line in Perl.
1.Using the strict pragma
2.Using the built-in debugger
3.Using the string pragma
4.Using the built-in error
The command @x=(1. .10) will assign first ten integer values to the array ‘a’.
1.True
2. False
3.all of the above
4.none of the above
The ___ prefix to an array name signifies the last index of the array.
1.$0
2. $#
3. #$
4.$_
To add elements to the left side of the array ____ function is used.
1.pop
2.push
3.queue
4.unshift
To add elements to the right side of the array ____ function is used.
1.pop
2. push
3.queue
4. unshift
To test whether perl is in your PATH, use ____
1. perl -e
2.perl -i
3. perl -el
4. perl -ed
We can specify filenames in command line using perl.
1.True
2.False
3.all of the above
4.none of the above
We can use find command for testing files with perl.
1.True
2.False
3.all of the above
4.none of the above
What will be the value in the variable $a after these two statements: $a = "Happy"; $a = "Sunday";?
1."Happy Sunday"
2."HappySunday"
3."Happy"
4."Sunday"
What will display the list of warning messages regarding the code?
1.Strict pragma
2.The -w Command-line argument
3.Using the built-in debugger
4.none of the above
When a string is used for numeral computations, perl converts it into ___
1.character
2. floating point number
3. number
4.boolean value
When the "require" function loads?
1.Runtime
2.Compile time
3.Both
4.none of the above
When you create a variable, you may assume it starts off containing
1.1
2.You may not make any assumption
3. The boolean value "false"
4.A null string (or 0 arithmetically)
When you're pattern matching, you describe the pattern using
1.A string in double quotes
2.A MySQL select statement
3.A regular expression
4.A template
Which escape character is used for identifying a word character?
1.s
2. d
3. w
4.
Which function is used by perl for displaying the length of a string?
1.string
2.len
3.split
4.length
Which function is used by perl for reversing a string?
1.rev
2.reverse
3.split
4.substr
Which function is used for handling substitutions in perl?
1.tr
2.s
3.str
4. tr and s
Which of the following are concatenation operators?
1./
2. .
3._
4. \
Which of the following is referred to as default variable?
1.$0
2.$1
3.$!
4. $_
Which of the following is used in perl?
1.else if
2. elseif
3.elsif
4.elif
Which of the following statement repeats a statement or group of statements until a given condition becomes true. It tests the condition before executing the loop body?
1.while
2.until
3.for
4.none of the above
Which of these is NOT available for Perl
1.Perl, legally, for free
2.Individual and site licenses
3.Full documentation of the language which you can print out yourself
4.A Caribbean cruise in 2006 on which you can meet some of the Perl gurus
Which one of the following is the most powerful filter?
1. awk
2.grep
3. sed
4.perl
___ function is used for removing the last character from the line.
1.cut
2.chop
3.erase
4. split
___ is known as range operator.
1.. .
2. $1
3. $.
4. $_
___ operator is used for selecting current line number.
1.$0
2.$1
3.$.
4. $_